<!--
 * @Author: wangshuixin 2412658453@qq.com
 * @Date: 2024-07-10 12:19:04
 * @FilePath: \web-components-box\components\Drawer\FullScreen.vue
 * @LastEditTime: 2024-07-10 12:31:21
 * @Description: 全屏组件
-->

<script setup lang="ts">
const props = defineProps({
  visible: {
    type: Boolean,
    default: false,
  },
  title: {
    type: String,
    default: '标题',
  },
  subTitle: {
    type: String,
    default: '',
  },
  exitTitle: {
    type: String,
    default: '退出',
  },
})
defineEmits(['exitFullscreen'])
</script>

<template>
  <div class="screen-overlay">
    <a-modal :visible="props.visible" :mask-closable="false" :render-to-body="false" :footer="false" :fullscreen="true" @cancel="$emit('exitFullscreen', true)">
      <template #title>
        <div class="screen-overlay-header">
          <div>
            {{ props.title }}
            <span class="ml-[16px] text-[14px] font-normal color-[#1D2129]">{{ props.subTitle }}</span>
          </div>
          <div>
            <a-button type="outline" @click="$emit('exitFullscreen', true)">
              {{ props.exitTitle }}
            </a-button>
          </div>
        </div>
      </template>
      <div>
        <slot name="content" />
      </div>
    </a-modal>
  </div>
</template>

<style scoped lang="less">
.screen-overlay {
  &-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    height: 60px;
    line-height: 60px;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    color: #1D2129;
    :deep(.arco-btn-outline) {
      padding-left: 12px;
      padding-right: 12px;
      height: 30px;
      font-size: 14px;
      font-weight: normal;
      color: #1D2129;
      border: 1px solid #E5E6EB;
    }
  }
  :deep(.arco-modal) {
    border-radius: 0px;
  }
  :deep(.arco-modal-header) {
    height: 60px;
  }
  :deep(.arco-modal-close-btn) {
    display: none;
  }
  // content 区域重置
  :deep(.arco-modal-body) {
    padding: 0px;
    max-height: calc(100vh - 60px) !important;
  }
}
</style>